<!DOCTYPE html>
<html lang="zh_cn">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title></title>
  <style>
    body,html{
      margin:0px;
      padding:0px;
    }

    #richText{
      border:1px solid #666;
      height:600px;
      outline: none;
    }
  </style>
</head>
<body>
  <div id="richText">

  </div>
  <button onclick="atl()">左对齐</button>
  <button onclick="atc()">居中</button>
  <button onclick="atr()">右对齐</button>
  <button onclick="toBold()">加粗</button>
  <button onclick="toItalic()">斜体</button>
  <button onclick="toBold()">最上级</button>

</body>
<script src="./js/zi.editer.core.js"></script>
<script>
  var edi=new ziEditer(document.getElementById('richText'))

  function atr(){
    edi.alignToRight()
  }

  function atl(){
    edi.alignToLeft()

  }

  function atc(){
    edi.alignToCenter()

  }

  function toBold(){
    edi.toBold()
  }

  function toItalic(){
    edi.toItalic()
  }

  function getP(){
    edi.getParent()
  }
</script>
</html>